<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class VideoValidate extends Validate
{
    protected $rule = [
        'id'                 => 'require|number',
        'title'              => 'require',
        'thumbnail'          => 'require',
        'video_category_id'  => 'require|number',
        'video_url'          => 'require',
    ];
    protected $message = [
        'id.require'                => 'id不能为空',
        'id.number'                 => 'id必须为数字',
        'title.require'             => '视频标题不能为空',
        'thumbnail.require'         => '视频封面图不能为空',
        'video_category_id.require' => '请选择视频分类',
        'video_category_id.number'  => '视频分类必须为数字',
        'video_url.require'         => '视频地址不能为空',
    ];

    protected $scene = [
        'add'  => ['title','thumbnail','video_category_id','video_url'],
        'edit' => ['id','title','thumbnail','video_category_id','video_url'],
    ];
}